<%@ page import="org.springframework.security.core.Authentication" %>
<%@ page import="ru.compft.common.utils.GlobalConstants" %>
<%@ include file="/includes/includes.jsp" %>
<div class="autorize">
    <div class="left bgimg"><spring:message
            code="version"/>:&nbsp;<%=application.getAttribute(GlobalConstants.MODULE_VERSION_PARAM_NAME)%>
    </div>
    <% final Authentication userPrincipal = (Authentication) request.getUserPrincipal();
        if (userPrincipal == null) {
    %>
    <a href="/login.do" class="bgimg"><spring:message code="enter"/></a>
    <%
    } else {
    %>
    <spring:message code="user"/>:&nbsp;<%=userPrincipal.getName()%>
    <spring:message code="authorities"/>:&nbsp;<%=userPrincipal.getAuthorities()%>
    <a href="<%=request.getContextPath()%>/j_spring_security_logout" class="bgimg">
        <spring:message code="exit"/>
    </a>
    <%
        }
    %>
    <span>
    <a href="?lang=en">en</a>
    |
    <a href="?lang=ru">ru</a>
    </span>

   <span>
    <a href="?theme=default">def</a>
    |
    <a href="?theme=black">blk</a>
    |
    <a href="?theme=blue">blu</a>
</span>
</div>